package cl.uchile.sketchpad.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cl.uchile.sketchpad.persistance.dao.ActivityDao;
import cl.uchile.sketchpad.persistance.model.Activity;

@Service
public class ActivityServiceImpl implements ActivityService {
	
	@Autowired
	private ActivityDao activityDao;

	@Override
	@Transactional(readOnly = true)
	public List<Activity> getAll() {
		return activityDao.getAll();
	}

	@Override
	@Transactional(readOnly = true)
	public Activity findById(Integer id) {
		return activityDao.findById(id);
	}

	@Override
	public void persist(Activity activity) {
		this.activityDao.persist(activity);
	}

}
